<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
if(empty($action))
{
?>
<title>已经购买的广告 - <?php echo $cfg_webname; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="templets/js/j.js"></script>
<script type="text/javascript" language='javascript' src='templets/js/main.js'></script>
<script type="text/javascript" language="javascript" src="../include/dedeajax2.js"></script>
<script type="text/javascript" src="templets/js/table_function.js"></script>
<script type="text/javascript" src="templets/js/leftmenu.js"></script>
<script type="text/javascript">
<!--
function CloseEditCatalog(){
	$Obj('editCatalog').style.display='none';
}
function Lookuser(cid){
	$Obj('editCatalog').style.display='block';
	var myajax = new DedeAjax($Obj('editCatalogBody'),false,true,"","","请稍候，正在载入...");
	myajax.SendGet2('buyad.php?cid='+cid+'&action=look');
	DedeXHTTP = null;
}
-->
</script>
<link href="templets/style/base.css" rel="stylesheet" type="text/css" />
<style>
<!--
#editCatalog {
	position:absolute;
	left:400px;
	top:0px;
	width:300px;
	height:400px;
	z-index:1;
	background-color: #F2FDDB;
	border:1px solid #889D8F;
	padding:6px;
	display:none
}
.exptime{color:#ccc}
.exptime a{color:#999}
-->
</style>
</head>
<body>
<div id="main">
<?php include(DEDEMEMBER."/templets/head.htm"); ?>
  <div id="content" class="w960 clearfix">
	<?php include(DEDEMEMBER."/templets/menu.php"); ?>
      <div id="mcpmain">
        <div id="appTab">
          <ul>
		    <li><a href="buyad.php">购买广告</a></li>
            <li class="thisTab"><a href="myad.php">我的广告</a></li>
            <li><a href="buy.php">管理金币</a></li>
          </ul>
        </div>
        <div id="mainCp">
          <div class="postForm">
            <div class="location">已购买的广告</div>
         <table cellspacing="1" class="list" width="100%">
            <thead>
              <tr>
			    <th width="20%">广告位名称</th>
                <th width="20%">所属分类</th>
				<th width="10%">位置</th>
                <th width="10%">类型</th>
                <th width="25%">到期时间</th>
                <th width="15%">操作</th>
              </tr>
            </thead>
            <tbody>
			{dede:datalist}
            <tr <?php if($ntime > $fields['endtime']) echo "class='exptime'";?>>
			  <td align="center">   <?php echo $fields['adname']; ?></td>
			  <td align="center">   <?php echo $fields['name']; ?></td>
			 <td align="center"><a href="javascript:Lookuser(<?php echo $fields['cid']?>);" title="广告位置预览" class="thickbox">预览</a></td>
             
           <td align="center"><?php
    	        if($fields['adtype']=='1') echo "文字";
		        else if($fields['adtype']=='2') echo "图片";
		        else echo "Flash";
		        ?></td>
            <td align="center"><?php echo GetDateTimeMk($fields['endtime']); ?></td>
            <td align="center">
			  <?php if($ntime > $fields['endtime']) { ?> 
                 已过期 <a href="buyad.php?action=buy&cid=<?php echo $fields['cid'];?>" style="color:#FF0000">续费</a>
              <?php } else {  ?> 
                 <a href="myad.php?action=edit&do=Renew&cid=<?php echo $fields['cid'];?>">编辑</a>
              <?php }?>
			   </td>
            </tr>
            {/dede:datalist}
            </tbody>
            
            <tfoot>
              <tr>
                <td colspan="7">
                <div class="pages mTB10 fRight">{dede:pagelist listsize=5/}</div>
                    <div class="clear"></div>
                  </td>
              </tr>
            </tfoot>
          </table>
<div id="editCatalog">
<span id='editCatalogBody'>请稍候，正在载入...</span>
</div>
        </div>
      </div>
      <div class="clear"></div>
    </div>
    <div class="clear"></div>
  </div>
</div>
<?php include(DEDEMEMBER."/templets/foot.htm"); ?>


<?php
}elseif($action == 'edit')
{
?>
<title>编辑广告 - <?php echo $cfg_webname; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>" />
<script type="text/javascript" src="templets/js/j.js"></script>
<script type="text/javascript" language='javascript' src='templets/js/main.js'></script>
<script type="text/javascript" language="javascript" src="../include/dedeajax2.js"></script>
<script type="text/javascript" src="templets/js/table_function.js"></script>
<script type="text/javascript" src="templets/js/leftmenu.js"></script>
<link href="templets/style/base.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="main">
<?php include(DEDEMEMBER."/templets/head.htm"); ?>
  <div id="content" class="w960 clearfix">
	<?php include(DEDEMEMBER."/templets/menu.php"); ?>
      <div id="mcpmain">
        <div id="appTab">
          <ul>
		    <li><a href="buyad.php">购买广告</a></li>
            <li class="thisTab"><a href="myad.php">我的广告</a></li>
            <li><a href="buy.php">管理金币</a></li>
          </ul>
        </div>
        <div id="mainCp">
          <div class="postForm">
            <div class="location">修改广告位</div>
            <form name="form2" action="myad.php" method="post">
            <table width="100%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="	background:#E2F5BC;">
              <input type="hidden" name="action" value="edit" />
              <input type="hidden" name="step" value="2" />
              <input type="hidden" name="adtype" value="<?php echo $sector['adtype'];?>" />
              <input type="hidden" name="cid" value="<?php echo $cid; ?>" />
		<tr>
        <td width="20%" height="35" align=right bgcolor="#FFFFFF">该广告位价格：</td>
        <td width="80%" bgcolor="#FFFFFF">&nbsp;&nbsp;<?php echo $sector['price']?>金币一周</td>
    </tr>
	<tr>
        <td height="35" align=right bgcolor="#FFFFFF">您购买了：</td>
        <td bgcolor="#FFFFFF">&nbsp;&nbsp;<?php echo $sector['times']?>周</td>
    </tr>
	<tr>
        <td height="35" align=right bgcolor="#FFFFFF">共花费金币数：</td>
        <td bgcolor="#FFFFFF">&nbsp;&nbsp;<?php echo $mones ?></td>
    </tr>
	<tr>
        <td height="35" align=right bgcolor="#FFFFFF">广告投放时间：</td>
        <td bgcolor="#FFFFFF">&nbsp;&nbsp;<?php echo GetDateTimeMk($sector['starttime'])?></td>
    </tr>
	<tr>
        <td height="35" align=right bgcolor="#FFFFFF">广告到期时间：</td>
        <td bgcolor="#FFFFFF">&nbsp;&nbsp;<?php echo GetDateTimeMk($sector['endtime'])?></td>
    </tr>
	<tr>
        <td height="35" align=right bgcolor="#FFFFFF">设置的广告内容：</td>
        <td bgcolor="#FFFFFF">&nbsp;&nbsp;(如果您投放的广告违反了相关法律，我们将删除该广告位！)</td>
    </tr>
	<?php echo $nbody; ?>
	<tr>
        <td height="35" bgcolor="#FFFFFF">&nbsp;&nbsp;</td>
        <td bgcolor="#F8FCF1"><button class="button2" type="submit">提交</button></td>
    </tr>
    </table>
<br>
<br>
</form>
 <div class="clear"></div>
    </div>
    <div class="clear"></div>
  </div>
</div>
<?php include(DEDEMEMBER."/templets/foot.htm"); ?>
<?php
}
?> 
</body>
</html>
